package com.msh.artascope.devcloud.service.service;

import com.msh.artascope.devcloud.client.po.ModuleBuildPo;
import com.msh.artascope.devcloud.client.po.ModulePo;
import com.msh.artascope.devcloud.client.po.ModuleRunningPo;
import com.msh.artascope.devcloud.client.qo.ModuleRunningQo;
import com.msh.artascope.devcloud.service.model.query.ModuleRunningQueryVo;
import com.msh.artascope.devcloud.service.model.vo.ModuleRunningVo;
import com.msh.artascope.devcloud.service.wrapper.K8sWrapper.K8sInfo;
import com.msh.artascope.interfaces.ILoginAccount;
import com.msh.frame.client.base.TenantBaseService;
import com.msh.frame.client.common.Result;
import java.util.List;

/**
 * @author shihu
 * @email m-sh@qq.com
 */
public interface ModuleRunningService extends TenantBaseService<ModuleRunningPo, ModuleRunningQo> {


  void reloadDestinationRule(ModulePo modulePo, K8sInfo k8s);

  // ----------前端vo处理-------------------------------------------------------
  Long insertVo(ModuleRunningVo vo);

  /**
   * id查询
   *
   * @param id 主键id
   * @return 查询Vo列表
   */
  ModuleRunningVo getVo(Long id, Long tenantId);

  /**
   * 查询
   *
   * @param q 查询QueryVo
   * @return 查询Vo列表
   */
  List<ModuleRunningVo> listVo(ModuleRunningQueryVo q);

  /**
   * 分页查询
   *
   * @param q 查询QueryVo
   * @return 分页查询Po列表
   */
  Result<List<ModuleRunningVo>> pageVo(ModuleRunningQueryVo q);

  void deleteVo(Long id, ILoginAccount loginAccount);

  void releaseVo(Long id, ILoginAccount loginAccount);

  void deleteWithDeployment(ModuleRunningPo moduleRunningPo, K8sInfo k8s, Long tenantId);

  Long createWithDeployment(ModulePo modulePo, ModuleBuildPo moduleBuildPo, K8sInfo k8s,
      String runningType,
      String headerKey, String headerValue, Long tenantId);

  Long createWithDeployment(Long moduleId, Long moduleBuildId, String runningType, String headerKey,
      String headerValue, Long tenantId);

  void setScale(Long id, Integer scale, Long tenantId);
}
